package cuiyt.datastructure.queue.priorityqueue;

import cuiyt.datastructure.common.Person;

/**
 * @author cyt
 * @describe 优先队列测试
 * @create 2021-01-10 20:30
 */
public class PriorityQueueTest {

    public static void main(String[] args) {
        Person p1 = new Person(12, "cuiyt1");
        Person p2 = new Person(14, "cuiyt2");
        Person p3 = new Person(2, "cuiyt3");
        Person p4 = new Person(1, "cuiyt4");
        Person p5 = new Person(99, "cuiyt5");

        PriorityQueue<Person> queue = new PriorityQueue<>();
        queue.enQueue(p1);
        queue.enQueue(p2);
        queue.enQueue(p3);
        queue.enQueue(p4);
        queue.enQueue(p5);

        while (!queue.isEmpty()) {
            System.out.println(queue.dnQueue());
        }

    }
}
